Crate binator_core

source ·
Expand description

Terminology:

NameDescription
StreamA structure that would produce Item when asked
ParserSomething that will check that Item produced by Stream are correct
ContextA structure that will manage Failure from Parser
TokenRepresent what a Parser return for Success
AtomA structure that contain information about the Failure or Error from a Parser
ElementSomething, generally an enumeration, that will contain all different kind of Atom
ParsedEnumeration that indicate result of a Parser
ParseA trait that all Parser implement, used to use a Parser
FailureIndicate a Parser didn’t validate the input
SuccessIndicate a Parser validate the input
ErrorIndicate a Parser encounter an irrecoverable error.
StreamingA trait that Stream implement to make their job
ItemItem produced by a Stream, generally just an u8
SpanA delimited part of the Stream
ContextingA trait that all Context will implement, used to accumulate failure of Parser

Structs§

  • This represent a stand alone Success from Parsed result.

Enums§

  • Core context used to implement context for basic type like u8
  • Parsed represent the result of a parse().
  • This is like Parsed but Succeed doesn’t contain stream
  • Represent split Result

Traits§

  • This is very usefull to be use on combinator like fold. For example, .fold_bounds(.., Vec::new, Acc::acc).
  • Contexting is a trait used to report failure and error. This idea is too have a tree of context that will help final user to understand the error. It’s can also help for debugging purpose.
  • Abstracts something which can extend an &mut self.
  • Parse is a trait that all parsers should implement. There is a blanked implementation for type that implement FnMut that match signature of parse(). This mean you can quickly use a function to implement a Parser.
  • This is an utily trait
  • Abstracts something which can push Item into self
  • This trait must be implement by all struct that want to be a stream for binator.
  • This is very usefull to be use on combinator like try_fold. For example, .try_fold_bounds(.., || Ok(Vec::new), TryAcc::try_acc).
  • Abstracts something which can try extend &mut self.
  • Abstracts something you can try push item into &mut self